import request from '@/utils/request'

export const GetNewsService = () => {
  return request.get('/news/list')
}

export const AddNewsService = (data) => {
  return request.post('/news/add', data)
}

export const EditNewsService = (data) => {
  return request.put('/news/update', data)
}

export const DelNewsService = (id) => {
  return request.delete('/news/delete', {
    params: { id }
  })
}

export const GetNewsFindByQueryService = (author) => {
  return request.get('/news/findByQuery', {
    params: { author }
  })
}

export const GetNewsDetailService = (id) => {
  return request.get('/news/findById', {
    params: { id }
  })
}